﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using DCTAccess.Business;
using DCTLib.Common;
public partial class AdminZone_AdminMaster : System.Web.UI.MasterPage
{
    private bool HasLoggedIn
    {
        get
        {
            return AppSessionInfo.CurrentRole == UserRole.Administrator;
        }
    }

    public string RootURL
    {
        get
        {
            return URLHelper.RootURL;
        }
    }

    private string Username
    {
        set
        {
            lblUserName.Text = value;
        }
        get
        {
            return lblUserName.Text;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (HasLoggedIn)
        {
            Username = AppSessionInfo.CurrentAdministrator.FullName;
        }
        else
        {
            Response.Redirect("AdminZone/AdminLogin.aspx");
        }
    }

    protected void btnAccountInfo_Click(object sender, EventArgs e)
    {
        Response.Redirect("AdminZone/AdminUpdate.aspx");
    }

    protected void btnLogout_Click(object sender, EventArgs e)
    {
        Session.Clear();
        CookieHelper.RemoveAllCookies();
        Response.Redirect("AdminZone/AdminLogin.aspx");
    }

    protected void btnResetPass_Click(object sender, EventArgs e)
    {
        Response.Redirect("AdminZone/AdminUpdate.aspx");
    }
}
